/////////////////////////////////////////////////////////////////////////////
// Name:        TestMainFrame.cpp
// Purpose:     
// Author:      Aleksey Plotnikov
// Modified by: 
// Created:     22/02/2011 13:31:14
// RCS-ID:      
// Copyright:   Diamant Group
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
#include "TestGrid.h"
////@end includes

#include "TestMainFrame.h"

////@begin XPM images
////@end XPM images


/*!
 * TestMainFrame type definition
 */

IMPLEMENT_CLASS( TestMainFrame, wxFrame )


/*!
 * TestMainFrame event table definition
 */

BEGIN_EVENT_TABLE( TestMainFrame, wxFrame )

////@begin TestMainFrame event table entries
////@end TestMainFrame event table entries

END_EVENT_TABLE()


/*!
 * TestMainFrame constructors
 */

TestMainFrame::TestMainFrame()
{
    Init();
}

TestMainFrame::TestMainFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create( parent, id, caption, pos, size, style );
}


/*!
 * TestMainFrame creator
 */

bool TestMainFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin TestMainFrame creation
    wxFrame::Create( parent, id, caption, pos, size, style );

    CreateControls();
    Centre();
////@end TestMainFrame creation
    return true;
}


/*!
 * TestMainFrame destructor
 */

TestMainFrame::~TestMainFrame()
{
////@begin TestMainFrame destruction
////@end TestMainFrame destruction
}


/*!
 * Member initialisation
 */

void TestMainFrame::Init()
{
////@begin TestMainFrame member initialisation
    m_TestGrid = NULL;
////@end TestMainFrame member initialisation
}


/*!
 * Control creation for TestMainFrame
 */

void	 TestMainFrame::CreateControls()
{    
////@begin TestMainFrame content construction
    TestMainFrame* itemFrame1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
    itemFrame1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW, 5);

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer4, 1, wxGROW, 5);

    m_TestGrid = new TestGrid( itemFrame1, ID_GRID, wxDefaultPosition, wxSize(200, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL );
    m_TestGrid->SetDefaultColSize(50);
    m_TestGrid->SetDefaultRowSize(25);
    m_TestGrid->SetColLabelSize(25);
    m_TestGrid->SetRowLabelSize(50);
    m_TestGrid->CreateGrid(1, 3, wxGrid::wxGridSelectCells);
    itemBoxSizer4->Add(m_TestGrid, 1, wxGROW, 5);

    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer6, 0, wxALIGN_RIGHT|wxALL, 5);

    wxButton* itemButton7 = new wxButton( itemFrame1, ID_START, _("Start tests"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton8 = new wxButton( itemFrame1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end TestMainFrame content construction

	m_TestGrid->set_GridMode();
}


/*!
 * Should we show tooltips?
 */

bool TestMainFrame::ShowToolTips()
{
    return true;
}

/*!
 * Get bitmap resources
 */

wxBitmap TestMainFrame::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin TestMainFrame bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end TestMainFrame bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon TestMainFrame::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin TestMainFrame icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end TestMainFrame icon retrieval
}
